package com.rnd.kx.mvp.contract;

import com.rnd.kx.mvp.base.BaseView;
import com.rnd.kx.mvp.bean.IndexBean;
import com.rnd.kx.mvp.bean.LoginBean;
import com.rnd.kx.mvp.bean.SearchBean;
import com.rnd.kx.mvp.http.bean.BaseObjectBean;

import io.reactivex.Flowable;
import retrofit2.http.Query;

public interface MainContract {
    interface Model {
        Flowable<BaseObjectBean<LoginBean>> login(String username, String password);
        Flowable<BaseObjectBean<SearchBean>> getSearch(String keywords);
        Flowable<BaseObjectBean<IndexBean>> getIndex();
    }

    interface View extends BaseView{
        @Override
        void showLoading();

        @Override
        void hideLoading();

        @Override
        void onError(Throwable throwable);

        void loginResult(BaseObjectBean<LoginBean> bean);

        void searchResult(BaseObjectBean<SearchBean> bean);

        void indexResult(BaseObjectBean<IndexBean> bean);
    }

    interface Presenter {
        /**
         * 登陆
         *
         * @param username
         * @param password
         */
        void login(String username, String password);

        void getSearch(String keywords);

        void getIndex();
    }
}
